package com.alinesno.cloud.common.web.base.advice;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

import com.alinesno.cloud.common.core.cache.CacheRedisUtil;  

public class PluginBase {

	@Autowired
	protected CacheRedisUtil cacheRedisUtil ;

	@Value("${alinesno.plugin.cache.time:300}")
	private long defaultPluginKeyTime ; 

	private String PLUGIN_KEY_PREFIX = "aliesno_plugin_key_" ; 

	protected void putPluginKey(String id, String applicationName) {
		cacheRedisUtil.set(PLUGIN_KEY_PREFIX + id , applicationName , defaultPluginKeyTime) ; 
	}


	protected Object getPluginByKey(String id) {
		return cacheRedisUtil.get(PLUGIN_KEY_PREFIX+id);
	}

	
}
